#列表
hobbies = ["听歌","看电影"]
print(hobbies)
#增加
hobbies.append("看书")
print(hobbies)
hobbies.append("跳舞")
print(hobbies)
#在指定位置增加
hobbies.insert(1,"逛街")
print(hobbies)
#移除
pop_hobbies = hobbies.pop()
print(pop_hobbies)
print(hobbies)
#移除指定的内容
hobbies.remove("听歌")
print(hobbies)
#替换内容
hobbies[0] = "吃东西"
print(hobbies)
#查找
_hobbies = "看电影"
if _hobbies in hobbies:
    print(hobbies.index(_hobbies))
else:
    print("%s 不在我们的列表中"%(_hobbies))
print(hobbies)

#切片
hobbies = ["听歌","看电影","看书","吃东西"]
print(hobbies[0],hobbies[1])
print(hobbies[1:2])
print(hobbies[0:2])
print(hobbies[:2])
print(hobbies[-3:-1])
print(hobbies[-3:])

a = [1,3,5,7,9,3]
print(a.count(3))

